using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._Package
{
    /// <summary>
    /// <para>Consolidate Map</para>
    /// <para>Consolidates a map and all referenced data sources to a specified output folder.</para>
    /// <para>将地图和所有引用的数据源合并到指定的输出文件夹。</para>
    /// </summary>    
    [DisplayName("Consolidate Map")]
    public class ConsolidateMap : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public ConsolidateMap()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_map">
        /// <para>Input Map</para>
        /// <para>The map (.mapx) to be consolidated. When running this tool within the ArcGIS Pro application, the input can be a map, scene, or basemap.</para>
        /// <para>要合并的地图 （.mapx）。在 ArcGIS Pro 应用程序中运行此工具时，输入可以是地图、场景或底图。</para>
        /// </param>
        /// <param name="_output_folder">
        /// <para>Output Folder</para>
        /// <para><xdoc>
        ///   <para>The output folder that will contain the consolidated map and data.</para>
        ///   <para>If the specified folder does not exist, a new folder will be created.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将包含合并地图和数据的输出文件夹。</para>
        ///   <para>如果指定的文件夹不存在，则将创建一个新文件夹。</para>
        /// </xdoc></para>
        /// </param>
        public ConsolidateMap(List<object> _in_map, object _output_folder)
        {
            this._in_map = _in_map;
            this._output_folder = _output_folder;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Consolidate Map";

        public override string CallName => "management.ConsolidateMap";

        public override List<string> AcceptEnvironments => ["extent", "workspace"];

        public override object[] ParameterInfo => [_in_map, _output_folder, _convert_data.GetGPValue(), _convert_arcsde_data.GetGPValue(), _extent, _apply_extent_to_arcsde.GetGPValue(), _preserve_sqlite.GetGPValue(), _select_related_rows.GetGPValue()];

        /// <summary>
        /// <para>Input Map</para>
        /// <para>The map (.mapx) to be consolidated. When running this tool within the ArcGIS Pro application, the input can be a map, scene, or basemap.</para>
        /// <para>要合并的地图 （.mapx）。在 ArcGIS Pro 应用程序中运行此工具时，输入可以是地图、场景或底图。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Map")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _in_map { get; set; }


        /// <summary>
        /// <para>Output Folder</para>
        /// <para><xdoc>
        ///   <para>The output folder that will contain the consolidated map and data.</para>
        ///   <para>If the specified folder does not exist, a new folder will be created.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将包含合并地图和数据的输出文件夹。</para>
        ///   <para>如果指定的文件夹不存在，则将创建一个新文件夹。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Folder")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _output_folder { get; set; }


        /// <summary>
        /// <para>Convert data to file geodatabase</para>
        /// <para><xdoc>
        ///   <para>Specifies whether input layers will be converted to a file geodatabase or preserved in their original format.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—All data will be converted to a file geodatabase. This option does not apply to enterprise geodatabase data sources. To include enterprise geodatabase data, check the Include Enterprise geodatabase data instead of referencing the data parameter.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Data formats will be preserved when possible. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是将输入图层转换为文件地理数据库还是以原始格式保留输入图层。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 所有数据都将转换为文件地理数据库。此选项不适用于企业级地理数据库数据源。要包含企业级地理数据库数据，请选中包括企业级地理数据库数据，而不是引用数据参数。</bullet_item><para/>
        ///     <bullet_item>未选中 - 将尽可能保留数据格式。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Convert data to file geodatabase")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _convert_data_value _convert_data { get; set; } = _convert_data_value._false;

        public enum _convert_data_value
        {
            /// <summary>
            /// <para>CONVERT</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("CONVERT")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>PRESERVE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("PRESERVE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Include Enterprise Geodatabase data instead of referencing the data</para>
        /// <para><xdoc>
        ///   <para>Specifies whether input enterprise geodatabase layers will be converted to a file geodatabase or preserved in their original format.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—All enterprise geodatabase data sources will be converted to a file geodatabase. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—All enterprise geodatabase data sources will be preserved and will be referenced in the resulting package.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是将输入企业级地理数据库图层转换为文件地理数据库还是以原始格式保留。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 所有企业级地理数据库数据源都将转换为文件地理数据库。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 将保留所有企业级地理数据库数据源，并将在生成的包中引用。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Include Enterprise Geodatabase data instead of referencing the data")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _convert_arcsde_data_value _convert_arcsde_data { get; set; } = _convert_arcsde_data_value._true;

        public enum _convert_arcsde_data_value
        {
            /// <summary>
            /// <para>CONVERT_ARCSDE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("CONVERT_ARCSDE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>PRESERVE_ARCSDE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("PRESERVE_ARCSDE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Extent</para>
        /// <para><xdoc>
        ///   <para>Specifies the extent that will be used to select or clip features.</para>
        ///   <bulletList>
        ///     <bullet_item>Default—The extent will be based on the maximum extent of all participating inputs. This is the default.</bullet_item><para/>
        ///     <bullet_item>Union of Inputs—The extent will be based on the maximum extent of all inputs.</bullet_item><para/>
        ///     <bullet_item>Intersection of Inputs—The extent will be based on the minimum area common to all inputs.</bullet_item><para/>
        ///     <bullet_item>Current Display Extent—The extent is equal to the visible display. The option is not available when there is no active map.</bullet_item><para/>
        ///     <bullet_item>As Specified Below—The extent will be based on the minimum and maximum extent values specified.</bullet_item><para/>
        ///     <bullet_item>Browse—The extent will be based on an existing dataset.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将用于选择或裁剪要素的范围。</para>
        ///   <bulletList>
        ///     <bullet_item>默认值 - 范围将基于所有参与输入的最大范围。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>输入并集 - 范围将基于所有输入的最大范围。</bullet_item><para/>
        ///     <bullet_item>输入交点 - 范围将基于所有输入共有的最小面积。</bullet_item><para/>
        ///     <bullet_item>当前显示范围 - 范围等于可见显示。当没有活动地图时，该选项不可用。</bullet_item><para/>
        ///     <bullet_item>如下所述 - 范围将基于指定的最小和最大范围值。</bullet_item><para/>
        ///     <bullet_item>浏览 - 范围将基于现有数据集。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Extent")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _extent { get; set; } = null;


        /// <summary>
        /// <para>Apply Extent only to enterprise geodatabase layers</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the specified extent will be applied to all layers or only to enterprise geodatabase layers.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—The extent will be applied to all layers. This is the default.</bullet_item><para/>
        ///     <bullet_item>Checked—The extent will be applied to enterprise geodatabase layers only.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定指定的范围是应用于所有图层还是仅应用于企业级地理数据库图层。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中 - 范围将应用于所有图层。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>选中 - 范围将仅应用于企业级地理数据库图层。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Apply Extent only to enterprise geodatabase layers")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _apply_extent_to_arcsde_value _apply_extent_to_arcsde { get; set; } = _apply_extent_to_arcsde_value._false;

        public enum _apply_extent_to_arcsde_value
        {
            /// <summary>
            /// <para>ARCSDE_ONLY</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ARCSDE_ONLY")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>ALL</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ALL")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Preserve SQLite</para>
        /// <para><xdoc>
        ///   <para>Instead of converting to a file geodatabase format, input SQLite data can be preserved as SQLite output. This parameter overrides the Convert data to file geodatabase parameter when the input data is SQLite. If the input data is a SQLite network dataset, the output will always be SQLite.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—SQLite data will be converted to file geodatabase. This is the default.</bullet_item><para/>
        ///     <bullet_item>Checked—SQLite data will be preserved as SQLite in the consolidated folder.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入 SQLite 数据可以保留为 SQLite 输出，而不是转换为文件地理数据库格式。当输入数据为 SQLite 时，此参数将覆盖将数据转换为文件地理数据库参数。如果输入数据是 SQLite 网络数据集，则输出将始终为 SQLite。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中 - SQLite 数据将转换为文件地理数据库。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>选中 - SQLite 数据将作为 SQLite 保留在合并文件夹中。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Preserve SQLite")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _preserve_sqlite_value _preserve_sqlite { get; set; } = _preserve_sqlite_value._false;

        public enum _preserve_sqlite_value
        {
            /// <summary>
            /// <para>PRESERVE_SQLITE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("PRESERVE_SQLITE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>CONVERT_SQLITE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("CONVERT_SQLITE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Keep only the rows which are related to features within the extent</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the specified extent will be applied to related data sources.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—Related data sources will be consolidated in their entirety. This is the default.</bullet_item><para/>
        ///     <bullet_item>Checked—Only related data corresponding to records within the specified extent will be consolidated.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否将指定的范围应用于相关数据源。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中 - 相关数据源将全部合并。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>选中 - 仅合并与指定范围内的记录对应的相关数据。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Keep only the rows which are related to features within the extent")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _select_related_rows_value _select_related_rows { get; set; } = _select_related_rows_value._false;

        public enum _select_related_rows_value
        {
            /// <summary>
            /// <para>KEEP_ONLY_RELATED_ROWS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("KEEP_ONLY_RELATED_ROWS")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>KEEP_ALL_RELATED_ROWS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("KEEP_ALL_RELATED_ROWS")]
            [GPEnumValue("false")]
            _false,

        }

        public ConsolidateMap SetEnv(object extent = null, object workspace = null)
        {
            base.SetEnv(extent: extent, workspace: workspace);
            return this;
        }

    }

}